//
//  XMPageControl.m
//  XMKit
//
//  Created by Ce Liu on 2018/5/29.
//  Copyright © 2018年 ChenXiaoMing. All rights reserved.
//

#import "XMPageControl.h"

@implementation XMPageControl

- (void)setCurrentPage:(NSInteger)page {
    [super setCurrentPage:page];
    for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
        if (subviewIndex == page) {
            UIImageView *subview = [self.subviews objectAtIndex:subviewIndex];
            CGSize size;
            size.height = 3;
            size.width = 10;
            [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y,
                                         size.width,size.height)];
        } else {
            UIImageView *subview = [self.subviews objectAtIndex:subviewIndex];
            CGSize size;
            size.height = 3;
            size.width = 3;
            [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y,
                                         size.width,size.height)];
        }
    }
}


@end
